package com.yasin.user.service;

import com.yasin.user.mappers.UserMapper;
import com.yasin.user.entity.User;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created by Yasin H on 2017/5/19.
 */
@Service("userService")
public class UserServiceImpl implements UserService {

    private static final Logger log = LoggerFactory.getLogger(UserServiceImpl.class);

    @Resource
    private UserMapper userMapper;

    public int insertUser(User user) {

        log.info("这是UserService在调用insertUser方法...");

        return userMapper.insert(user);
    }

    public User selectUserById(Integer id) {

        log.info("这是UserService在调用selectUserById方法...");

        return userMapper.selectByPrimaryKey(id);
    }
}
